import { ADD_PERSON } from '../constants';
const personList = [{ id: '001', name: 'tom', age: 18 }]
export default function personReducer(prestate = personList, e) {
  const { type, data } = e;
  switch (type) {
    case ADD_PERSON:
      //纯函数
      return [data, ...prestate]
    default:
      return prestate
  }
}